﻿namespace Devonline.AspNetCore.TimeSeries;

/// <summary>
/// 时序数据库操作的抽象接口
/// </summary>
/// <typeparam name="TModel"></typeparam>
public interface ITimeSeriesDataService<TModel> where TModel : class, new()
{
    /// <summary>
    /// 写入一行记录到数据库
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
    Task WriteAsync(TModel model);
    /// <summary>
    /// 写入多行记录到数据库
    /// </summary>
    /// <param name="data"></param>
    /// <returns></returns>
    Task WritesAsync(IEnumerable<TModel> data);
    /// <summary>
    /// 查询数据库
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    Task<IEnumerable<TModel>> QueryAsync(FluxQueryRequest request);
}